package com.gosophia.resource.action;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.OrderCondition;
import com.gosophia.commons.Page;
import com.gosophia.commons.PropertyFilter;
import com.gosophia.commons.web.action.BaseAjaxAction;
import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.dataDictionary.dto.DataEntryDTO;
import com.gosophia.resourcePermission.dto.ResourcePermissionDTO;
import com.gosophia.resourcePermission.ws.ResourcePermissionWebService;
import com.gosophia.util.RequestResultUtil;

/**
 * 分页显示资源列表
 * 
 * @author zhao_yanfang
 * 
 */
@Controller("showResourcePageAction")
@Scope("prototype")
public class ShowResourcePageAction extends BaseAjaxAction<ResourcePermissionDTO> {

	private static final Log logger = LogFactory
	.getLog(ShowResourcePageAction.class);
	private static final long serialVersionUID = 1L;
//	private Page<ResourcePermissionDTO> page;
	private String searchCond="";
	private List<OrderCondition> orderConditions;
	@Autowired
	private ResourcePermissionWebService resourcePermissionWebService;

	public String _execute() throws Exception {
		logger.info("查询资源集:pageNo="+page.getPageNo()+";pageSize="+page.getPageSize()+";searchCond="+searchCond+";orderConditions="+orderConditions);
		page = resourcePermissionWebService
				.findResourceByPage(page.getPageSize(),page.getPageNo(),
						searchCond, orderConditions);
		logger.info("资源集结果为"+page.getResult().size());
//		requestResult=RequestResultUtil.getPageRequestResult(page);
		return SUCCESS;
	}
	public String getSearchCond() {
		return searchCond;
	}

	public void setSearchCond(String searchCond) {
		this.searchCond = searchCond;
	}

	public List<OrderCondition> getOrderConditions() {
		return orderConditions;
	}

	public void setOrderConditions(List<OrderCondition> orderConditions) {
		this.orderConditions = orderConditions;
	}

	public ResourcePermissionWebService getResourcePermissionWebService() {
		return resourcePermissionWebService;
	}

	public void setResourcePermissionWebService(
			ResourcePermissionWebService resourcePermissionWebService) {
		this.resourcePermissionWebService = resourcePermissionWebService;
	}
	@Override
	public ResourcePermissionDTO getDetailData() {
		// TODO Auto-generated method stub
		return null;
	}




	

}
